package com.fortune.service.impl;

import com.faneui.common.exception.BusinessException;
import com.fortune.dal.dao.FundMarketDAO;
import com.fortune.dal.model.FundMarket;
import com.fortune.service.FundMarketService;
import com.fortune.update.FundMarketUpdateEvent;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.stereotype.Service;

@Service
public class FundMarketServiceimpl extends ApplicationObjectSupport implements FundMarketService {

    protected static final Logger logger = LoggerFactory.getLogger(FundMarketService.class);

    @Autowired
    private FundMarketDAO fundMarketDAO ;

    @Override
    public void updateFundMarketBaseData(FundMarket fundMarket) throws BusinessException {
        try{
            fundMarketDAO.updateById(fundMarket) ;
            getApplicationContext().publishEvent(new FundMarketUpdateEvent(fundMarket));
        }catch (Exception ex) {

        }

    }
}
